home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
TCXL21.LZH
/
TCXL.H
< prev
next >
Wrap
Text File
|
1988-01-24
|
9KB
|
204 lines
/*----------------------------------------------------------------------------
TCXL.H - by Mike Smedley.
This file is a header file used to declare function
prototypes and macro definitions. It is called by
the line: #include "tcxl.h"
----------------------------------------------------------------------------*/
#ifdef __STDC__
#define _Cdecl
#else
#define _Cdecl cdecl
#endif
void _Cdecl beep(void);
char *_Cdecl biosver(void);
void _Cdecl box(int srow,int scol,int erow,int ecol,int btype,int atr);
void _Cdecl boxd(int srow,int scol,int erow,int ecol,int btype,int atr);
int _Cdecl clockcal(void);
void _Cdecl clreol_(void);
void _Cdecl clrscrn(void);
void _Cdecl delay_(unsigned duration);
unsigned _Cdecl extmem(void);
int _Cdecl fcmpdatm(char *fname1,char *fname2);
void _Cdecl fill(int srow,int scol,int erow,int ecol,int ch,int atr);
void _Cdecl filld(int srow,int scol,int erow,int ecol,int ch,int atr);
int _Cdecl getchf(char *valid);
unsigned _Cdecl getktot(int drive);
int _Cdecl getsf(char *str,int max);
char *_Cdecl getvol(char drive);
void _Cdecl gotoxy_(int row,int col);
void _Cdecl lprintc(int ch);
void _Cdecl lprints(char *str);
void _Cdecl lprintsf(char *str,int count);
int _Cdecl machid(void);
void _Cdecl mode(int mode_code);
void _Cdecl printc(int row,int col,int attr,int ch,int count);
void _Cdecl printcd(int row,int col,int attr,int ch);
void _Cdecl prints(int row,int col,int attr,char *str);
void _Cdecl printsd(int row,int col,int attr,char *str);
int _Cdecl readchat(void);
void _Cdecl readcur(int *row,int *col);
void _Cdecl revattr(int count);
void _Cdecl scrndump(void);
void _Cdecl setattr(int attr,int count);
void _Cdecl setcursz(int sline,int eline);
void _Cdecl sound_(unsigned pitch,unsigned duration);
void _Cdecl spc(int num);
void _Cdecl srestore(int *sbuf);
int *_Cdecl ssave(void);
void _Cdecl strchg(char *str,char oldch,char newch);
int _Cdecl strdel(char *substr,char *str);
void _Cdecl strichg(char *str,char oldch,char newch);
int _Cdecl stridel(char *substr,char *str);
char *_Cdecl striinc(char *str1,char *str2);
char *_Cdecl strinc(char *str1,char *str2);
int _Cdecl striocc(char *str,int ch);
char *_Cdecl strmid(char *str,int st_pos,int num_chars);
int _Cdecl strocc(char *str,int ch);
char *_Cdecl strsetsz(char **str,int newsize);
int _Cdecl tabstop(int col,int tabwidth);
unsigned long _Cdecl timer(void);
int _Cdecl vidtype(void);
int _Cdecl wactiv(int whandle);
int _Cdecl waitkey(void);
void _Cdecl wclear(void);
void _Cdecl wclose(void);
void _Cdecl wclreol(void);
int *_Cdecl whide(int **wbuf);
int _Cdecl wgetc(void);
int _Cdecl wgetchf(char *valid);
void _Cdecl wgets(char *str);
int _Cdecl wgetsf(char *str,int max);
int _Cdecl wgotoxy(int wrow,int wcol);
int _Cdecl wmove(int nsrow,int nscol);
int _Cdecl wopen(int srow,int scol,int erow,int ecol,int btype,int attr);
int _Cdecl wprintc(int wrow,int wcol,int attr,int ch);
int _Cdecl wprints(int wrow,int wcol,int attr,char *str);
void _Cdecl wputc(int ch);
void _Cdecl wputs(char *str);
void _Cdecl wputsf(char *str,int width);
void _Cdecl wrestore(int *wbuf);
int *_Cdecl wsave(int srow,int scol,int erow,int ecol);
int _Cdecl wsize(int nerow,int necol);
void _Cdecl wscroll(int count,int direction);
/* structure of window records */
struct _wrecord {
int *wbuf; /* address of window's buffer */
int whandle; /* window's handle */
unsigned char row; /* window's current row */
unsigned char column; /* window's current column */
unsigned char attr; /* window's current text attribute */
unsigned char btype; /* window's box type */
unsigned char wattr; /* window's initial text attribute */
};
extern struct _wrecord _wrecord[]; /* variables used by window mgr */
extern int _wcurrent;
extern int _whandle;
/* return codes from SOME of
the windowing functions */
#define W_NOERR 0 /* no error */
#define W_ALLOCERR 1 /* memory allocation error */
#define W_NOTFOUND 2 /* window handle not found */
#define W_NOACTIVE 3 /* no active (open) windows */
#define W_INVCOORD 4 /* invalid coordinates */
#define W_ESCPRESS 5 /* Escape key was pressed */
#define DOWN 0 /* for wscroll() function */
#define UP 1
#define MDA 0 /* display adapter types */
#define CGA 1
#define EGA 2
/* keyboard status definitions */
#define RSHIFT 1 /* right shift pressed */
#define LSHIFT 2 /* left shift pressed */
#define CTRL 4 /* <Ctrl> pressed */
#define ALT 8 /* <Alt> pressed */
#define SCRLOCK 16 /* <Scroll Lock> toggled */
#define NUMLOCK 32 /* <Num Lock> toggled */
#define CAPSLOCK 64 /* <Caps Lock> toggled */
#define INS 128 /* <Ins> toggled */
#ifndef BLACK
#define BLACK 0 /* foreground colors */
#define BLUE 1
#define GREEN 2
#define CYAN 3
#define RED 4
#define MAGENTA 5
#define BROWN 6
#define YELLOW 14
#define WHITE 15
#endif
#define LGREY 7 /* TCXL abbreviates LIGHT as L */
#define DGREY 8 /* and DARK as D for ease of use */
#define LBLUE 9
#define LGREEN 10
#define LCYAN 11
#define LRED 12
#define LMAGENTA 13
#define _BLACK 0 /* background colors */
#define _BLUE 16
#define _GREEN 32
#define _CYAN 48
#define _RED 64
#define _MAGENTA 80
#define _BROWN 96
#define _LGREY 112
#define BLINK 128 /* blinking attribute */
#define BEL 7 /* control characters */
#define BS 8
#define HT 9
#define LF 10
#define FF 12
#define CR 13
#define ESC 27
#define NO 0 /* Boolean conditions */
#define YES 1
#define FALSE 0
#define TRUE 1
#define OFF 0
#define ON 1
/* for machid() function */
#define IBMPC 255 /* IBM PC */
#define IBMPCXT 254 /* IBM PC/XT */
#define IBMPCJR 253 /* IBM PCjr */
#define IBMPCAT 252 /* IBM PC/AT */
#define IBMCONV 249 /* IBM PC Convertible */
#define SPERRYPC 48 /* Sperry PC */
#define KBFLAG 0,0x417 /* seg,ofs address of keyboard flag */
#define attrib(f,b,i,bl) ((b<<4)|(f)|(i<<3)|(bl<<7))
#define capsoff() poke(KBFLAG,peek(KBFLAG)&191)
#define capson() poke(KBFLAG,peek(KBFLAG)|64)
#define clearkeys() while(kbhit()) getch()
#define clrwin(a,b,c,d) gotoxy_(a,b);fill(a,b,c,d,' ',(readchat()>>8))
#define cls() clrscrn()
#define fhide(a) _chmod(a,1,2)
#define gameport(a) ((a&4096)>>12)
#define home() gotoxy_(0,0)
#define kbstat() peek(KBFLAG)
#define lcrlf() lprintc(CR);lprintc(LF)
#define mathchip(a) ((a&2)>>1)
#define numflop(a) (((a&192)>>6)+1)
#define numoff() poke(KBFLAG,peek(KBFLAG)&223)
#define numon() poke(KBFLAG,peek(KBFLAG)|32)
#define numpar(a) (((unsigned)(a&-16384))>>14)
#define numser(a) ((a&3584)>>9)
#define prompts(pr,st) cputs(pr);gets(st)
#define strleft(st,nu) strmid(st,0,nu)
#define strright(st,nu) strmid(st,strlen(st)-nu,nu)
#define wtextattr(a) _wrecord[_wcurrent].attr=a
#define wunhide(a) whide(a)